<template>
  <div class="category">
    <h2>{{title}}</h2>
    <!-- 内容区 -->
    <div class="content">
      <ul v-if="games">
        <li v-for="g in games" :key="g.id">{{g.name}}</li>
      </ul>
      <img :src="food" alt="" v-if="food">
      <video controls :src="movie" v-if="movie"></video>
    </div>
  </div>
</template>

<script>
  export default {
    name:'Category',
    props:['title','games','food','movie']
  }
</script>

<style scoped>
  .category {
    background-color: skyblue;
    padding: 10px;
    width: 240px;
    height: 300px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
  }
  h2 {
    text-align: center;
    background-color: orange;
  }
  img {
    width: 100%;
  }
  video {
    width: 100%;
  }
</style>